﻿using HRIS.Browser.Resources;
using HRIS.Browser.UI.Framework;
using HRIS.Browser.UI.Framework.DesktopWebControls;
using Iit.Automation.Browsers.Shared;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium.Interactions;
using System;

namespace HRIS.TimeTracker
{
    [TestClass]
    public class Tracker
    {
        [TestMethod]
        public void HRISLogin()
        {
            ResourceManager _chromeResources = ResourceManager.GetInstance(IitEnums.RegisteredBrowsers.Chrome, IitEnums.PlatFormTypes.Desktop);
            _chromeResources.Browser.Url = "http://hris.initto.com/adrenalin/";
            Login login = (Login)_chromeResources.Browser.ComponentFactory.GetComponent<ILogin>();
            login.DoLogin("int430", "Hilary@03");

            TopMenu menu = (TopMenu)_chromeResources.Browser.ComponentFactory.GetComponent<IMenuBase>();
            Actions actMenuHoverClick = _chromeResources.Browser.GetAction();
            actMenuHoverClick.MoveToElement(menu[HRISEnums.MenuItems.MIS].Element).Perform();
            menu[HRISEnums.MenuItems.MIS][HRISEnums.MenuItems.ClockInClockOut].Element.Click();
           // actMenuHoverClick.Click().Perform();
        }
    }
}
